package ysq.xyg.service;

import com.github.pagehelper.PageInfo;
import ysq.xyg.model.WinNum;

import java.util.List;

/**
 * @author yu sheng qiang
 * @create 2017-04-19 14:10
 **/
public interface WinNumService extends BaseService<WinNum> {
    //分页查询
    public PageInfo<WinNum> pageInfo(WinNum winNum, int pageSize, int pageNum);
    //条件查询
    public List<WinNum> list(WinNum winNum);
    //分页查询
    public PageInfo<WinNum> pageInfoLeft(WinNum winNum, int pageSize, int pageNum);

    /**
     * 自动生成中奖号
     * 10000000开始，以num为结束
     */
    int generateWinNum(int totalNum, String activityId);

    /**
     * 绑定中奖号
     */
    int winningNum(String memberId, String activityId, int num,String itemId);

    /**
     * 查询判断是否已全部
     */
    long selectCountNoMember(String activityId);

    /**
     * 只取一条记录
     */
    void randOneWinNum(String activityId);

    /**
     * 查询中奖
     */
    long selectCountWin(String activityId);

    /**
     * 查询
     */
    List<WinNum> selectEntity(WinNum record);

    /**
     * 设置活动默认中奖号
     */
    int defaultWinningNum(String activityId, String winningNum);
}
